import request from '@/utils/request'

// 查询设备保养规则列表
export function listDeviceMaintenanceRule(query) {
  return request({
    url: '/erp/deviceMaintenanceRule/list',
    method: 'get',
    params: query
  })
}

// 查询设备保养规则详细
export function getDeviceMaintenanceRule(id) {
  return request({
    url: '/erp/deviceMaintenanceRule/' + id,
    method: 'get'
  })
}

// 新增设备保养规则
export function addDeviceMaintenanceRule(data) {
  return request({
    url: '/erp/deviceMaintenanceRule',
    method: 'post',
    data: data
  })
}

// 修改设备保养规则
export function updateDeviceMaintenanceRule(data) {
  return request({
    url: '/erp/deviceMaintenanceRule',
    method: 'put',
    data: data
  })
}

// 删除设备保养规则
export function delDeviceMaintenanceRule(id) {
  return request({
    url: '/erp/deviceMaintenanceRule/' + id,
    method: 'delete'
  })
}

// 设置保养规则
export function setRuleAct(data) {
  return request({
    url: '/erp/deviceMaintenanceRule/install',
    method: 'post',
    data: data
  })
}
